<template>
    <div>
        <div class="m-integration-bg">
            <div>
                <span>{{change}}</span>
                <p>可用积分</p>
            </div>
        </div>
        <intergration-tab @chooseTab='chooseTab'></intergration-tab>

        <div class="m-items p1">
            <no-data v-if="integralList.length<1"></no-data>
          <project-item v-else class="m-item" v-for="(item,index) in integralList" :key="index" 
          :jifen="true" :project="item" :sta="item.sta"></project-item>
        </div>
    </div>
</template>
<script>
import {integralProjectsList} from '@/api/mine';
export default {
    name:'',
    data () {
        return {
            integralList:[],
            type:0,
            param:{
                sta:0,      //项目类别  0综合，1项目，2产品，3卡项
                type:0,
            },
            change:0,
        }
    },
    components: {
        intergrationTab:()=>import('@/model/mine/integrationTab'),
        projectItem:()=>import('@/model/projectList/projectItem'),
    },
    methods: {
        // 选择项目类型
        chooseTab(data) {
            this.param = data;
            this.getIntegralProjectsList();
        },
        getIntegralProjectsList() {
            let that = this;
            let param = Object.assign({
                CustomerId:that.$utils.uid,
            },that.param);
            integralProjectsList(param).then((result) => {
                that.integralList = result.list;
                that.change = result.change;        //可用积分
            }).catch((err) => {
                
            });
        }
    },
    mounted() {
        this.getIntegralProjectsList();
    }
}
</script>
<style lang="less" scoped src='@/less/mine/integration.less'></style>
